package org.jrfe.gfx.g2d.shapes;

import org.jrfe.JRFE;
import org.jrfe.gfx.Vertex;
import org.jrfe.math.Vector2f;

public class Line extends AbstractShape {


	private Vector2f vectorOne;
	private Vector2f vectorTwo;
	
	
	public Line(Vector2f v1,Vector2f v2) {
		super(2,JRFE.PrimitiveTypes.LINES);	
	
		vectorOne = v1;
		vectorTwo = v2;
		
		Vertex v = new Vertex();
		
		v.a = 1;
		v.r = 1;
		v.g = 1;
		v.b = 1;

		
		v.x = v1.x;
		v.y = v1.y;
		getBatch().update(0, v);
		
		v.x = v2.x;
		v.y = v2.y;
		getBatch().update(1, v);
		
	}
	public Vector2f getVectorOne() {
		return vectorOne;
	}
	
	public Vector2f getVectorTwo() {
		return vectorTwo;
	}
	
	public void update(){
		getBatch().updateVertex(0, vectorOne.x);
		getBatch().updateVertex(1, vectorOne.y);
	
		getBatch().updateVertex(2, vectorTwo.x);
		getBatch().updateVertex(3, vectorTwo.y);
	}
	
}
